import _ from 'lodash';
import './style.css';  //测试加载CSS文件
import MyIcon from './icon.jpg';
import Data from './data.json';
import PrintMe from './print.js';

function component1() {
    var ele1 = document.createElement('div');
    ele1.innerHTML = _.join(['Hello 1', 'FizeChan'], ' ');
    return ele1;
}

function component2() {
    var ele2 = document.createElement('div');
    ele2.innerHTML = _.join(['Hello 2', 'FizeChan'], ' ');
    ele2.style.backgroundColor = '#ABCD11';
    ele2.style.backgroundImage = "url(" + MyIcon + ")";
    return ele2;
}

function component3() {
    var ele3 = document.createElement('div');
    ele3.innerHTML = _.join([Data['name'], Data['age']], ' ');
    ele3.style.backgroundColor = '#ABCD11';
    ele3.style.backgroundImage = "url(" + MyIcon + ")";
    return ele3;
}

document.body.appendChild(component1());
document.body.appendChild(component2());

var myIcon = new Image();
myIcon.src = MyIcon;

document.body.appendChild(myIcon);

document.body.appendChild(component3());

PrintMe();